Re: [SQL] Stepping through a table. - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] Stepping through a table.
Date
Msg-id l03130300b3dd85696085@[147.233.159.109]
Whole thread Raw
In response to Stepping through a table.  (Matthew Hagerty <matthew@venux.net>)
Responses Re: [SQL] Stepping through a table.
List pgsql-sql
At 05:58 +0300 on 16/08/1999, Matthew Hagerty wrote:


> If I need to process each record in a table, how can I step through each
> record?  I suppose I could write a query to return all records and fetch
> each row that way, but that would be a big memory pig, no?  Also, the table
> could get pretty big.  Is there some way to navigate a table, maybe
> fetching one record from the disk at a time, or something similar?

I guess you are looking for cursors. Read about it on page 154 of the
PostgreSQL user guide, or check out the manpage about "declare". Note that
PostgreSQL cursors are readonly, and can't be used to update information.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




pgsql-sql by date:

Previous
From: Stuart Rison
Date:
Subject: Re: [SQL] Anyone recognise this error from PL/pgSQL?
Next
From: "Dionisio Barrantes"
Date:
Subject: unsuscribe